<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>upPerson</title>
    <link rel="stylesheet" href="css/fore/index.css">
    <link rel="stylesheet" href="css/bootstrap/3.3.6/bootstrap.css">
    <link rel="stylesheet" href="css/fore/lunbotu.css">
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link rel="stylesheet" href="css/fore/Cooldog.css">
    <link rel="stylesheet" href="css/fore/iconfont.css">
    <link rel="stylesheet" href="css/fore/upcoach.css">
    <script src="js/Cooldog.js"></script>
    <script src="js/vue.min.js"></script>
    <script src="js/fetch.min.js"></script>
    <script src="js/axios.min.js"></script>
</head>
<body>
<div id="allContent">
    <div class="header">
        <div class="top">
            <div class="top-logo fl">
                <a id="logo" href="#nowhere"><img src="img/car-logo.png" alt="" class="fl" style="margin-top: 20px;width: 45px">
                    <span class="top-logo-text">练车预约系统</span></a>
            </div>
        </div>
        <div class="header-nav">
            <ul id="nav-list">
                <li class="nav-list-li"><a href="index.html">首页</a></li>
                <li class="nav-list-li"><a href="selectcoach.html">明星教练</a></li>
                <li class="nav-list-li"><a href="testorder.html">考试报名</a></li>
                <li class="nav-list-li"><a href="order.html">练车预约</a></li>
                <li class="nav-list-li"><a href="teachingvideo.html">驾考视频</a></li>
                <li class="nav-list-li"><a href="register.html">驾校报名</a></li>
            </ul>
        </div>
    </div>
    <div class="main">
        <div class="main-con">
            <form  action="fore_student_reset" class="form-horizontal" method="post" enctype="multipart/form-data">
                <div class="form-group">
                    <label for="inputText1" class="col-sm-2 control-label">学员姓名</label>
                    <div class="col-sm-10">
                        <input name="name" type="text" class="form-control" id="inputText1" v-model="user.student.name" required>
                    </div>
                </div>
                <div class="form-group">
                <label for="inputText2" class="col-sm-2 control-label">密码</label>
                <div class="col-sm-10">
                    <input name="password" type="text" class="form-control" id="inputText2" v-model="user.password" required>
                </div>
                </div>
                <div class="form-group">
                    <label  for="image1" class="col-sm-2 control-label">更换头像</label>
                    <div class="col-sm-10">
                        <img :src="['img/student/' + user.pic]" class="img-circle" height="50px">
                        <span><input  name="pic" type="file" id="image1" accept="image/jpg, image/jpeg, image/png"></span>
                    </div>
                </div>

                <div class="form-group">
                     <label  class="col-sm-2 control-label">科目二</label>
                    <div class="col-sm-10">
                        总共训练{{time2}}小时
                    </div>
                </div>
                <div class="form-group">
                     <label  class="col-sm-2 control-label">科目三</label>
                    <div class="col-sm-10">
                        总共训练{{time3}}小时
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputText5" class="col-sm-2 control-label">电话</label>
                    <div class="col-sm-10">
                        <input type="text" name="telephone" class="form-control" id="inputText5"
                               v-model="user.student.telephone" required>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputText6" class="col-sm-2 control-label">身份证</label>
                    <div class="col-sm-10">
                        <input type="text" name="identity" class="form-control" id="inputText6" v-model="user.student.identity" required>
                    </div>
                </div>

                <div class="form-group">
                    <label for="11" class="col-sm-2 control-label">身份证</label>
                    <div class="col-sm-10">
                        <select id="11" name=sex class="form-control" :value="user.sex"required>
                            <option value="女">女</option>
                            <option value="男">男</option>
                        </select>
                        <!--<input type="text" name="identity" class="form-control" id="11" v-model="user.student.identity" required>-->
                    </div>
                </div>

                <div class="form-group">
                    <label for="inputText7" class="col-sm-2 control-label">住址</label>
                    <div class="col-sm-10">
                        <input type="text" name="address" class="form-control" id="inputText7" v-model="user.student.address" required>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-warning">重置</button>
                    </div>
                </div>
            </form>

        </div>



    </div>
</div>
<div class="footer">
    <p>
        Good CarTeacher©2018 | QQ:123456789
        <a href="#">|关于我们</a>
        <a href="login.html">|驾校登录</a>
    </p>
</div>
<script>
    var url = "fore_student_updateUser";
    new Vue({
        el: '#allContent',
        data: {
            user: [],
            time2: [],
            time3: []
        },
        mounted: function () {
            self = this;
            fetch(url).then(function (response) {
                response.json().then(function (jsonObject) {
                    console.log(jsonObject);
                    self.user = jsonObject.user; //数组
                    self.time2 = jsonObject.time2;
                    self.time3 = jsonObject.time3;
                }).catch(function (err) {
                    console.log("Fetch错误：" + err);
                })
            })
        }
    });
</script>

</body>
</html>